package com.paypal.android.MEP;

import android.content.Context;
import android.graphics.Typeface;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.GradientDrawable.Orientation;
import android.graphics.drawable.StateListDrawable;
import android.text.SpannableString;
import android.text.style.UnderlineSpan;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.paypal.android.a.c;
import com.paypal.android.a.g;
import com.paypal.android.a.j;

public final class a extends LinearLayout
  implements View.OnClickListener
{
  private static boolean p = false;
  private int a;
  private int b;
  private int c;
  private int d;
  private boolean e;
  private LinearLayout f;
  private GradientDrawable g;
  private TextView h;
  private TextView i;
  private LinearLayout j;
  private Context k;
  private StateListDrawable l;
  private TextView m;
  private TextView n;
  private ImageView o;

  public a(Context paramContext)
  {
    super(paramContext);
    this.k = paramContext;
  }

  public final void a()
  {
    int i1 = 1;
    e locale = e.a();
    p = false;
    b();
    if ((locale.t()) && (locale.u() == i1))
    {
      this.e = i1;
      if ((!this.e) || (this.h.getText().toString().length() <= 0))
        break label104;
      this.f.setVisibility(0);
      setMinimumWidth(this.b);
      setMinimumHeight(this.c + this.d);
      setBackgroundDrawable(this.g);
    }
    while (true)
    {
      invalidate();
      return;
      i1 = 0;
      break;
      label104: this.f.setVisibility(8);
      setMinimumWidth(this.b);
      setMinimumHeight(this.c);
      setBackgroundColor(0);
    }
  }

  protected final void a(int paramInt1, int paramInt2)
  {
    this.a = paramInt1;
    int i1;
    float f1;
    Typeface localTypeface;
    float f2;
    switch (this.a)
    {
    case 1:
    default:
      this.b = 194;
      this.c = 37;
      this.d = 20;
      i1 = 22;
      f1 = 6.0F;
      localTypeface = Typeface.create("Helvetica", 0);
      f2 = 10.0F + 2.5F * this.a;
      float f3 = this.d - 8.0F;
      float f4 = e.a().B();
      this.b = ((int)(f4 * this.b));
      this.c = ((int)(f4 * this.c));
      this.d = ((int)(f4 * this.d));
      setOrientation(1);
      setPadding(0, 0, 0, 0);
      this.g = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[] { -1, -1 });
      this.g.setSize(this.b, this.c + this.d);
      this.g.setCornerRadius(f1);
      this.g.setStroke(1, -5789785);
      this.f = new LinearLayout(this.k);
      this.f.setLayoutParams(new LinearLayout.LayoutParams(-1, this.d));
      this.f.setOrientation(0);
      this.f.setPadding(0, 2, 0, 0);
      this.h = new TextView(this.k);
      this.h.setLayoutParams(new LinearLayout.LayoutParams(-1, -1, 1.0F));
      this.h.setGravity(3);
      this.h.setPadding(5, 0, 0, 0);
      this.h.setTypeface(localTypeface, 1);
      this.h.setTextSize(f3);
      this.h.setTextColor(-15066598);
      this.h.setSingleLine(true);
      this.h.setText("");
      this.h.setOnClickListener(this);
      this.i = new TextView(this.k);
      this.i.setLayoutParams(new LinearLayout.LayoutParams(-2, -1));
      this.i.setGravity(5);
      this.i.setPadding(0, 0, 5, 0);
      this.i.setTypeface(localTypeface);
      this.i.setTextSize(f3);
      this.i.setTextColor(-14993820);
      this.i.setFocusable(true);
      SpannableString localSpannableString = new SpannableString(j.a("ANDROID_not_you"));
      localSpannableString.setSpan(new UnderlineSpan(), 0, localSpannableString.length(), 0);
      this.i.setText(localSpannableString);
      this.i.setOnClickListener(this);
      this.f.addView(this.h);
      this.f.addView(this.i);
      addView(this.f);
      this.j = new LinearLayout(this.k);
      this.j.setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
      this.j.setGravity(17);
      this.j.setOrientation(0);
      this.j.setPadding(2, 2, 2, 2);
      this.j.setOnClickListener(this);
      GradientDrawable localGradientDrawable1 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[] { -4922, -22016 });
      localGradientDrawable1.setSize(this.b, this.c);
      localGradientDrawable1.setCornerRadius(f1);
      localGradientDrawable1.setStroke(1, -3637191);
      GradientDrawable localGradientDrawable2 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[] { -12951, -1937101 });
      localGradientDrawable2.setSize(this.b, this.c);
      localGradientDrawable2.setCornerRadius(f1);
      localGradientDrawable2.setStroke(1, -3637191);
      this.l = new StateListDrawable();
      this.l.addState(new int[] { -16842919 }, localGradientDrawable1);
      this.l.addState(new int[] { 16842919 }, localGradientDrawable2);
      this.j.setBackgroundDrawable(this.l);
      if (paramInt2 != 1)
        break;
    case 0:
    case 2:
    case 3:
    }
    String str2;
    String str3;
    String[] arrayOfString;
    for (String str1 = "donate"; ; str1 = "pay")
    {
      str2 = e.a().h().toLowerCase();
      str3 = str2.substring(0, 2);
      arrayOfString = j.a("ANDROID_" + str1 + "_button").split("%PP", -1);
      for (int i2 = 0; i2 < arrayOfString.length; i2++)
      {
        int i4 = arrayOfString[0].indexOf("\\n");
        if (i4 != -1)
          arrayOfString[i2] = (arrayOfString[i2].substring(0, i4) + '\n' + arrayOfString[i2].substring(i4 + 2));
      }
      this.b = 152;
      this.c = 33;
      this.d = 18;
      i1 = 22;
      f1 = 6.0F;
      break;
      this.b = 278;
      this.c = 43;
      this.d = 22;
      i1 = 30;
      f1 = 10.0F;
      break;
      this.b = 294;
      this.c = 45;
      this.d = 28;
      i1 = 40;
      f1 = 10.0F;
      break;
    }
    float f5;
    int i3;
    if ((str3.equals("pl")) || ((str3.equals("fr")) && (str1.equals("donate"))))
    {
      f5 = f2 - (2.0F + 0.5F * this.a);
      i3 = 3;
    }
    while (true)
    {
      this.m = new TextView(this.k);
      if (!arrayOfString[0].equals(""))
      {
        this.m.setText(arrayOfString[0]);
        this.m.setTypeface(localTypeface, i3);
        this.m.setTextSize(f5);
        this.m.setTextColor(-14993820);
        this.m.setGravity(17);
        this.m.setVisibility(0);
        label1158: this.n = new TextView(this.k);
        if ((arrayOfString.length <= 1) || (arrayOfString[1].equals("")))
          break label1461;
        this.n.setText(arrayOfString[1]);
        this.n.setTypeface(localTypeface, i3);
        this.n.setTextSize(f5);
        this.n.setTextColor(-14993820);
        if (arrayOfString[0].equals(""))
          this.n.setGravity(17);
        this.n.setVisibility(0);
      }
      while (true)
      {
        String str4 = "paypal_";
        if (str2.equals("zh_hk"))
          str4 = str4 + "cn_";
        String str5 = str4 + "logo_" + i1 + ".png";
        this.o = g.a(this.k, str5);
        this.o.setVisibility(0);
        this.j.addView(this.m);
        this.j.addView(this.o);
        this.j.addView(this.n);
        addView(this.j);
        a();
        setSelected(false);
        return;
        if ((!str3.equals("zh")) && (!str3.equals("jp")))
          break label1473;
        f5 = f2 + (2.0F + 0.5F * this.a);
        i3 = 1;
        break;
        this.m.setVisibility(8);
        break label1158;
        label1461: this.n.setVisibility(8);
      }
      label1473: f5 = f2;
      i3 = 3;
    }
  }

  public final void b()
  {
    String str = e.a().p();
    if (str.length() > 21)
      str = str.substring(0, 21) + "...";
    this.h.setText(str);
  }

  public final void onClick(View paramView)
  {
    if (p);
    while (paramView == this.h)
      return;
    if (paramView == this.i)
    {
      e.a("CheckoutButton", "reset the account");
      e.a().w();
      c.f().a(12);
      com.paypal.android.MEP.a.g.a = true;
    }
    while (true)
    {
      p = true;
      performClick();
      setActive(false);
      return;
      if (paramView == this.j)
        com.paypal.android.MEP.a.g.a = false;
    }
  }

  public final void setActive(boolean paramBoolean)
  {
    setClickable(paramBoolean);
    setFocusable(paramBoolean);
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.paypal.android.MEP.a
 * JD-Core Version:    0.6.2
 */